package com.greyshark.sanotrive.splash

import android.widget.ImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.greyshark.sanotrive.R


/**
 *
 * 作者：sosou
 *
 * 版本：1.0
 *
 * 创建日期：15/2/2023
 *
 * 描述：
 *
 * 修订历史：
 *
 */
class SplashGuideDotAdapter(currentItem: Int=0) :
    BaseQuickAdapter<Int, BaseViewHolder>(R.layout.item_splash_guide_dot_layout) {

    private var currentItem: Int = currentItem

    override fun convert(helper: BaseViewHolder, item: Int) {
        helper.getView<ImageView>(R.id.picImg).isSelected = (currentItem == helper.layoutPosition)
    }


    fun setCurPosition(position: Int){
        currentItem = position
        notifyDataSetChanged()
    }
}